<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      // const str = {
      //   0,-10: "h",
      //   1,-9: "e",
      //   2,-8: "l",
      //   3,-7: "l",
      //   4,-6: "o",
      //   5,-5: " ",
      //   6,-4: "j",
      //   7,-3: "a",
      //   8,-2: "c",
      //   9,-1: "k",
      // };
      const str = "Hello jack";
      console.log("str.slice(1,8)", str.slice(1, 8));
      console.log("str.substr(1,8)", str.substr(1, 8));
      console.log("str.substr(-8,8)", str.substr(-8, 8));
      console.log("str.substr(-8)", str.substr(-8));
    </script>
  </body>
</html>
